//
//  TestSearchViewController.m
//  SmartWatch
//
//  Created by zwj on 2022/11/24.
//

#import "TestSearchViewController.h"

@interface TestSearchViewController ()

@end

@implementation TestSearchViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.isHideNavigationBar = YES;
    self.view.backgroundColor = BACKGROUNDCOLOR;
}

- (void)initSubviews {
    [super initSubviews];
    
    MyLinearLayout *root = [MyLinearLayout linearLayoutWithOrientation:MyOrientation_Horz];
    root.myHorzMargin = 0;
    root.gravity = MyGravity_Vert_Bottom;
    root.myHeight = NavigationContentTop;
    root.padding = UIEdgeInsetsMake(StatusBarHeightConstant, 15, 10, 15);
    root.subviewHSpace = 10;
    root.backgroundColor = COLOR_4;
    [self.view addSubview:root];
    
    UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [backBtn setImage:UIImageMake(@"icon_arrow_left") forState:UIControlStateNormal];
    backBtn.frame = CGRectMake(15, StatusBarHeightConstant, 32, 32);
    backBtn.imageEdgeInsets = UIEdgeInsetsMake(6,6,6,6);
    [backBtn addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
    [root addSubview:backBtn];
    
    QMUITextField *tf = [[QMUITextField alloc]init];
    tf.weight = 1;
    tf.myHeight = 32;
    tf.backgroundColor = HexColor(@"#F5F5F5");
    NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] initWithString:@"搜索昵称、手机号" attributes:
                                                 @{NSForegroundColorAttributeName:HexColor(@"#BABABA"),
                                                   NSFontAttributeName:UIFontMake(14)}
    ];
    ViewCorner(tf, 5);
    tf.attributedPlaceholder = attrString;
    [root addSubview:tf];
    
    UIButton *submitBtn = [UIButton createButtonText:@"搜索" font:UIFontMake(14) textColor:COLOR_4];
    submitBtn.myWidth = 64;
    submitBtn.myHeight = 32;
    ViewCorner(submitBtn, 5);
    [submitBtn az_setGradientBackgroundWithColors:@[HexColor(@"#4BD8B1"),HexColor(@"#2CAED8")] locations:@[@0.0,@1.0] startPoint:CGPointMake(0, 0) endPoint:CGPointMake(1, 1)];
    [submitBtn addTarget:self action:@selector(submitBtnClick) forControlEvents:UIControlEventTouchUpInside];
    [root addSubview:submitBtn];
}

- (void)submitBtnClick {
    
}

@end
